home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 101-125 / 108 / dots-perfect / init.asm < prev    next >
Assembly Source File  |  1995-03-13  |  2KB  |  125 lines

  1.  
  2. **** initialization for DotsPerfect-MX80 ********************
  3.  
  4.     SECTION        printer
  5.  
  6. *---- Included files ----------------------------------------------
  7.  
  8.     INCLUDE        "driver.i"
  9.  
  10. *---- Imported Functions ------------------------------------------
  11.  
  12.     XREF_EXE    CloseLibrary
  13.     XREF_EXE    OpenLibrary
  14.     XREF        _AbsExecBase
  15.  
  16.     XREF        _PEDData
  17.  
  18. *---- Exported Globals --------------------------------------------
  19.  
  20.     XDEF        _Init
  21.     XDEF        _Expunge
  22.     XDEF        _Open
  23.     XDEF        _Close
  24.     XDEF        _PD
  25.     XDEF        _PED
  26.     XDEF        _SysBase
  27.     XDEF        _DOSBase
  28.     XDEF        _GfxBase
  29.     XDEF        _IntuitionBase
  30.  
  31. *******************************************************************
  32.  
  33.     SECTION        printer,DATA
  34. _PD        DC.L    0
  35. _PED        DC.L    0
  36. _SysBase    DC.L    0
  37. _DOSBase    DC.L    0
  38. _GfxBase    DC.L    0
  39. _IntuitionBase    DC.L    0
  40.  
  41. *******************************************************************
  42.  
  43.     SECTION        printer,CODE
  44. _Init:
  45.         MOVE.L    4(A7),_PD
  46.         LEA    _PEDData(PC),A0
  47.         MOVE.L    A0,_PED
  48.         MOVE.L    A6,-(A7)
  49.         MOVE.L    _AbsExecBase,A6
  50.         MOVE.L    A6,_SysBase
  51.  
  52. *    ;------------open the dos library
  53.         LEA    DLName(PC),A1
  54.         MOVEQ    #0,D0
  55.         CALLEXE    OpenLibrary
  56.         MOVE.L    D0,_DOSBase
  57.         BEQ    initDLErr
  58.  
  59. *    ;------------open the graphics library
  60.         LEA    GLName(PC),A1
  61.         MOVEQ    #0,D0
  62.         CALLEXE    OpenLibrary
  63.         MOVE.L    D0,_GfxBase
  64.         BEQ    initGLErr
  65.  
  66. *    ;------------open the intuition library
  67.         LEA    ILName(PC),A1
  68.         MOVEQ    #0,D0
  69.         CALLEXE    OpenLibrary
  70.         MOVE.L    D0,_IntuitionBase
  71.         BEQ    initILErr
  72.  
  73.         MOVEQ    #0,D0
  74. pdiRts:
  75.         MOVE.L    (A7)+,A6
  76.         RTS
  77.  
  78. initPAErr:
  79.         MOVE.L    _IntuitionBase,A1
  80.         LINKEXE    CloseLibrary
  81.  
  82. initILErr:
  83.         MOVE.L    _GfxBase,A1
  84.         LINKEXE    CloseLibrary
  85.  
  86. initGLErr:
  87.         MOVE.L    _DOSBase,A1
  88.         LINKEXE    CloseLibrary
  89.  
  90. initDLErr:
  91.         MOVEQ    #-1,D0
  92.         BRA.S    pdiRts
  93.  
  94. ILName:
  95.         DC.B    'intuition.library'
  96.         DC.B    0
  97.  
  98. DLName:
  99.         DC.B    'dos.library'
  100.         DC.B    0
  101.  
  102. GLName:
  103.         DC.B    'graphics.library'
  104.         DC.B    0
  105.         DS.W    0
  106.  
  107. *----------------------------------------------------------------
  108. _Expunge:
  109.         MOVE.L    _IntuitionBase,A1
  110.         LINKEXE    CloseLibrary
  111.  
  112.         MOVE.L    _GfxBase,A1
  113.         LINKEXE    CloseLibrary
  114.  
  115.         MOVE.L    _DOSBase,A1
  116.         LINKEXE    CloseLibrary
  117.  
  118. *----------------------------------------------------------------
  119. _Open:
  120. _Close:
  121.         MOVEQ    #0,D0
  122.         RTS
  123.         
  124.         END
  125.